<template>
  <div class="login">
    <div class="content">
      <h1 class="loginText">账号信息</h1>
      <div class="content-form">
        <van-form @submit="onSubmit">
          <van-field
            v-model="username"
            name="用户名"
            label="用户名"
            placeholder="用户名"
            :rules="[{ required: true, message: '请填写用户名' }]"
          />
          <van-field
            v-model="password"
            type="password"
            name="密码"
            label="密码"
            placeholder="密码"
            :rules="[{ required: true, message: '请填写密码' }]"
          />

          <p><a href="javascript:;">验证码登录</a> <span>&gt;</span></p>

          <div style="margin: 16px">
            <van-button
              round
              block
              type="info"
              native-type="submit"
              @click="$router.push('/personal')"
              >登录</van-button
            >
          </div>
        </van-form>
        <van-button round block type="info" @click="$router.push('/register')"
          >去注册</van-button
        >
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Login",

  data() {
    return {
      username: "",
      password: "",
    };
  },

  mounted() {},

  methods: {
    onSubmit(values) {
      console.log("submit", values);
    },
  },
};
</script>
<style lang="scss" scoped>
.login {
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  .content {
    .loginText {
      font-size: 30px;
      font-weight: bold;
      margin-bottom: 20px;
      letter-spacing: 10px;
      margin-left: 10px;
    }
    .content-form {
      p {
        width: 100%;
        text-align: right;
      }
      a {
        color: #999;
      }
      span {
        font-family: "宋体";
      }
    }
  }
}
</style>